import Observer from "../common/Observer";
window.onload=function(){
    window.onhashchange=function(){
        checkHash(location.hash)
    }

    function checkHash(hash){
        if(hash==='#regist'){
            Observer.emit('regist-show')
            Observer.emit('login-hide')
            // Observer.emit('content-hide')
        }else if(hash==='#login'){
            Observer.emit('login-show')
            Observer.emit('regist-hide')
            // Observer.emit('content-hide')
        }else{
            Observer.emit('login-hide')
            Observer.emit('regist-hide')
        }
    }
    checkHash(location.hash)
}

Observer.on('changeHash',function(newHash){
    location.hash=newHash
})